package com.example.easy.mapper;

import com.example.easy.Dto.Notice;
import com.example.easy.Dto.ResourceProtection;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ResourceProtectionMapper {

    @Insert("Insert into resource_protection (number,title,content,time)Values(#{number},#{title},#{content},#{time})")
    int insResourceProtection(ResourceProtection resourceProtection);//插入

    @Update("UPDATE resource_protection  SET title=#{title},content=#{content},time=#{time} WHERE number=#{number}")
    int updateResourceProtection(ResourceProtection resourceProtection);//修改

    @Delete("DELETE FROM resource_protection WHERE  number=#{number}")
    int deleteResourceProtection(int number);//删除

    @Select("SELECT * FROM resource_protection  WHERE number=#{number} ")
    ResourceProtection selectResourceProtection(int number);//查看文章所有信息

    @Select("SELECT * FROM resource_protection ")
    List <ResourceProtection> selectall();//查看所有文章

}
